package com.xmu.prcs.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
/**
 * 科表
 * @author frequent
 *
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "kindke", uniqueConstraints = @UniqueConstraint(columnNames = "kindname"))
public class KindKe implements Serializable {

	private Integer idKindKe;
	private String kindName;//分类名
	private Date updateTime;//增加时间
	private Set<KindShu> kindShus;//科下的所有属
	
	public KindKe(){
		
	}
	
	public KindKe(String kindname){
		this.kindName = kindname;
	}

	@Id
	@GeneratedValue
	@Column(name = "idkindke", unique = true, nullable = true)
	public Integer getIdKindKe() {
		return idKindKe;
	}

	public void setIdKindKe(Integer idKindKe) {
		this.idKindKe = idKindKe;
	}

	@Column(name = "kindname", length = 10)
	public String getKindName() {
		return kindName;
	}

	public void setKindName(String kindName) {
		this.kindName = kindName;
	}
	
	@Column(name = "updatetime")
	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinColumn(name = "idkindke")
	public Set<KindShu> getKindShus() {
		return kindShus;
	}

	public void setKindShus(Set<KindShu> kindShus) {
		this.kindShus = kindShus;
	}
	
}
